#ifndef PROFILES_H
#define PROFILES_H

#include <QDialog>

namespace Ui {
class Profiles;
}

class Profile : public QObject
{
    Q_OBJECT

public:
    Profile(const QString& name){
        setName(name);
    }

    inline void setName(const QString& name){ _name = name;}
    inline void setNumbers(const int num){ numbers = num;}
    inline void setCycles(const int num){ cycles = num;}
    inline void setFrequency(const int msecs) { frequency = msecs;}
    inline void setPause(const int msecs) { pause = msecs; }

    inline QString getName() const { return _name; }
    inline int getNumbers() const { return numbers; }
    inline int getCycles() const { return cycles; }
    inline int getFrequency() const { return frequency; }
    inline int getPause() const { return pause; }


private:
    QString _name;
    int numbers;
    int cycles;
    int frequency;
    int pause;
};

class QStandardItemModel;
class QModelIndex;

class Profiles : public QDialog
{
    Q_OBJECT
    
public:
    explicit Profiles(QWidget *parent = 0);
    ~Profiles();

    void accept();
    void selectProfile(const QString& profile);

private slots:
    void add();
    void remove();
    void currentChanged( const QModelIndex &current );
    void currentChanged( const QModelIndex &current, const QModelIndex &previous );
    void paramChanged(int value);

private:
    void save();
    void load();

    Ui::Profiles *ui;
    QStandardItemModel* model;
};

#endif // PROFILES_H
